import com.dao.UserInfDao;
import com.dao.searchdao;
import com.dao.searchdaoimpl;
import com.entity.productdetails;
import com.entity.user;

import javax.swing.*;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Scanner;

public class text {
    public static void main(String[] args) {
        //DecimalFormat df=new DecimalFormat("#.00");
        Scanner c = new Scanner(System.in);
        String message = c.nextLine();
        UserInfDao u = new UserInfDao();
        List<productdetails> list = new ArrayList<>();
        String sql1 = "select * from productdetails where Zone like CONCAT('%',?,'%')";
//        String sql2 = "select * from productdetails where Level like CONCAT('%',?,'%')";
        String sql3 = "select * from productdetails where PDID in (" +
                "select PDID from product where GameID in (" +
                "select GameID from game where GameName like CONCAT('%',?,'%'))" +
                ")";
        String sql4 = "select * from productdetails where UnitPrice like CONCAT('%',?,'%')";
        String sql5 = "select * from productdetails where ProductValue like ?";
        List<productdetails> list1 = u.getForList(productdetails.class, sql1, message);
//        List<productdetails> list2 = u.getForList(productdetails.class, sql2, message);
        List<productdetails> list3 = u.getForList(productdetails.class, sql3, message);
        List<productdetails> list4 = u.getForList(productdetails.class, sql4, message);
        List<productdetails> list5 = u.getForList(productdetails.class, sql5, message);

        for (int i = 0; i < list5.size(); i++) {
            assert false;
            list.add(list5.get(i));
        }

        for (int i = 0; i < list4.size(); i++) {
            assert false;
            list.add(list4.get(i));
        }

        for (int i = 0; i < list3.size(); i++) {
            assert false;
            list.add(list3.get(i));
        }

//        for (int i = 0; i < list2.size(); i++) {
//            assert false;
//            list.add(list2.get(i));
//        }
        for (int i = 0; i < list1.size(); i++) {
            assert false;
            list.add(list1.get(i));
        }

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i).getAccount());
        }
    }
}

